<?php
class Blacklist extends AppModel {

    public $validate = array(
    'ip_address' => array(
    'rule-1' => array('rule' => 'ip','message'=>'IP address is not valid'),
    'rule-2' => array('rule' => 'isUnique','message' => 'IP address already exists')
    )
    );

    public function check($ip_address) {
        return $this->find(array('ip_address'=>$ip_address));
    }
}
?>